package models

import "time"

// 商超订单商品明细表,分表规则company_id除1000取模
type OrderPro struct {
	Id                    uint      `gorm:"column:(id)"  json:"id"`
	CompanyId             uint      `gorm:"column:(company_id)" description:"企业id" json:"company_id"`
	ShopId                uint      `gorm:"column:(shop_id)" description:"店铺id" json:"shop_id"`
	No                    string    `gorm:"column:(no)"  json:"no"`
	Type                  string    `gorm:"column:(type)" description:"类型： 普通|服务费|桌位费|" json:"type"`
	Proid                 int       `gorm:"column:(proid)" description:"商品id" json:"proid"`
	SkuNo                 string    `gorm:"column:(sku_no)" description:"商品sku" json:"sku_no"`
	BarCode               string    `gorm:"column:(bar_code)" description:"商品条码" json:"bar_code"`
	Name                  string    `gorm:"column:(name)" description:"商品名称" json:"name"`
	Num                   float32   `gorm:"column:(num)" description:"购买数量" json:"num"`
	InitPrice             float32   `gorm:"column:(init_price)" description:"实际销售价格收银机端传入" json:"init_price"`
	Price                 float32   `gorm:"column:(price)" description:"实际销售价格:单价=total_receivable_amount除num" json:"price"`
	CostPrice             float32   `gorm:"column:(cost_price)" description:"商品进价" json:"cost_price"`
	OriginalPrice         float32   `gorm:"column:(original_price)" description:"商品原售价:零售价" json:"original_price"`
	TotalCostAmount       float32   `gorm:"column:(total_cost_amount)" description:"商品的总成本:cost_price乘num" json:"total_cost_amount"`
	TotalDiscountAmount   float32   `gorm:"column:(total_discount_amount)" description:"当前商品的总优惠金额total_original_amount-应收金额" json:"total_discount_amount"`
	TotalReceivableAmount float32   `gorm:"column:(total_receivable_amount)" description:"当前商品的应收金额:通过订单理论金额和商品理论金额比例换算而来" json:"total_receivable_amount"`
	TotalOriginalAmount   float32   `gorm:"column:(total_original_amount)" description:"理论总金额original_price乘num" json:"total_original_amount"`
	DiscountRate          float32   `gorm:"column:(discount_rate)" description:"折扣率  默认1 不打折" json:"discount_rate"`
	UnitName              string    `gorm:"column:(unit_name)"  json:"unit_name"`
	PicUrl                string    `gorm:"column:(pic_url)"  json:"pic_url"`
	StaffId               int       `gorm:"column:(staff_id)" description:"员工id  销售员工" json:"staff_id"`
	SaleRemark            string    `gorm:"column:(sale_remark)" description:"销售备注" json:"sale_remark"`
	Remark                string    `gorm:"column:(remark)" description:"商品备注" json:"remark"`
	Flavor                string    `gorm:"column:(flavor)" description:"多维度 口味备注" json:"flavor"`
	FinishTime            time.Time `gorm:"column:(finish_time)" description:"订单结束时间" json:"finish_time"`
	StandardDate          string    `gorm:"column:(standard_date)"  json:"standard_date"`
	CreateTime            time.Time `gorm:"column:(create_time)"  json:"create_time"`
	CateId                int       `gorm:"column:(cate_id)" description:"分类id" json:"cate_id"`
	CateNo                string    `gorm:"column:(cate_no)" description:"分类编码" json:"cate_no"`
	CategoryName          string    `gorm:"column:(category_name)" description:"分类名称" json:"category_name"`
	SupplierId            int       `gorm:"column:(supplier_id)" description:"供应商id" json:"supplier_id"`
	SupplierNo            string    `gorm:"column:(supplier_no)" description:"供应商编号" json:"supplier_no"`
	SupplierName          string    `gorm:"column:(supplier_name)" description:"供应商名称" json:"supplier_name"`
	BrandId               int       `gorm:"column:(brand_id)"  json:"brand_id"`
	BrandNo               string    `gorm:"column:(brand_no)" description:"品牌编号" json:"brand_no"`
	BrandName             string    `gorm:"column:(brand_name)" description:"品牌名称" json:"brand_name"`
	BusinessType          string    `gorm:"column:(business_type)" description:"经营方式" json:"business_type"`
	IsPresent             string    `gorm:"column:(is_present)" description:"是否赠送" json:"is_present"`
	KeyName               string    `gorm:"column:(key_name)" description:"款式" json:"key_name"`
	PackageJson           string    `gorm:"column:(package_json)" description:"套餐数据" json:"package_json"`
	VipPriceJson          string    `gorm:"column:(vip_price_json)" description:"会员价数据" json:"vip_price_json"`
	Pid                   int       `gorm:"column:(pid)" description:"关联id" json:"pid"`
	Commission            float32   `gorm:"column:(commission)" description:"销售提成金额" json:"commission"`
	TaxMode               uint      `gorm:"column:(tax_mode)" description:"税务模式 账单优先级" json:"tax_mode"`
	ReturnRate            float32   `gorm:"column:(return_rate)" description:"联营扣点" json:"return_rate"`
	PayWay                string    `gorm:"column:(pay_way)" description:"支付方式" json:"pay_way"`
	SerialNum             string    `gorm:"column:(serial_num)" description:"商品编号" json:"serial_num"`
	PurchaseSpecification string    `gorm:"column:(purchase_specification)"  json:"purchase_specification"`
}
